#
# build example and install to prefix/bin directory if needed
#
# target_link_libraries(): https://cmake.org/cmake/help/v3.10/command/target_link_libraries.html
# target_compile_options(): https://cmake.org/cmake/help/v3.10/command/target_compile_options.html
# target_compile_definitions(): https://cmake.org/cmake/help/v3.10/command/target_compile_definitions.html
# target_include_directories(): https://cmake.org/cmake/help/v3.10/command/target_include_directories.html
#

unset(COMPONENT_LIBRARY)
if(${BUILD_SHARED_LIBS} STREQUAL "ON")
    set(COMPONENT_LIBRARY ${COMPONENT_NAME})
else()
    set(COMPONENT_LIBRARY ${COMPONENT_NAME}_static)
endif()

add_executable(example example.c)
install(FILES example.c DESTINATION example/${COMPONENT_NAME})

add_executable(timer_eg timer_eg.c)
target_link_libraries(timer_eg simpost_timer pthread)
install(FILES timer_eg.c DESTINATION example/${COMPONENT_NAME})
